package tdh.xt.common.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @package com.xt.util
 * @description 获取配置文件中属性相关的工具类
 * @author Ricardo
 * @date 2021/5/10 2:38
 * @copyright (c) 2021,南京通达海科技股份有限公司 All Rights Reserved.
 * @version 1.0
 * Modification History:
 * Date                  Author      Version     Description
 * ------------------------------------------------------------------
 * 2021/5/10 2:38       Ricardo       1.0     获取配置文件中属性相关的工具类
 */
public class SourceUtil {

    private SourceUtil(){}

    public static String getPropertyValue(String sourceName, String key) throws IOException {
        InputStream input = SourceUtil.class.getClassLoader().getResourceAsStream(sourceName);
        Properties properties = new Properties();
        properties.load(input);
        return properties.getProperty(key);
    }
}
